home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / languages / oberon.lha / Oberon-FAQ-Language.doc < prev    next >
Encoding:
Text File  |  1995-03-07  |  12.8 KB  |  238 lines

  1. Newsgroups: comp.lang.oberon,comp.answers,news.answers
  2. Path: bloom-beacon.mit.edu!gatech!europa.eng.gtefsd.com!library.ucla.edu!psgrain!m2xenix!mikeg
  3. From: mikeg@psg.com (Mike Gallo)
  4. Subject: Comp.lang.oberon FAQ (monthly) 2/3
  5. Expires: Fri, 20 Jan 1995 00:00:00 GMT
  6. Reply-To: mikeg@psg.com
  7. Organization: PSGnet, Portland Oregon US
  8. Date: Tue, 20 Dec 1994 14:06:18 GMT
  9. Approved: news-answers-request@MIT.Edu
  10. Message-ID: <1994Dec20.140618.27037@psg.com>
  11. Followup-To: comp.lang.oberon
  12. Summary: This posting contains a list of Frequently Asked Questions (and their answers) about Oberon.  It should be read before posting to the Comp.lang.oberon newsgroup.
  13. Lines: 221
  14. Xref: bloom-beacon.mit.edu comp.lang.oberon:3511 comp.answers:9055 news.answers:31596
  15.  
  16. Archive-name: Oberon-FAQ/language
  17.  
  18. (*  * *  * *  * *  * *  * *  * *  * *  * *  * *  * *  * *  * *  * *  * *  *)
  19.  
  20. Many FAQ lists, including this one, are available by anonymous ftp from rtfm.mit.edu in the /pub/usenet/news.answers directory.
  21.  
  22. Although I have aimed for accuracy, there is no guarantee that the information in this document is error-free.  Neither the FAQ maintainer nor anyone else associated with this document assume any liability for the content or use of this document.  If you find any errors, please report them to the address below.
  23.  
  24. Thanks to all who have contributed!  Further additions, corrections, and suggestions are welcome.
  25.  
  26. mikeg@psg.com
  27.  
  28. (*  * *  * *  * *  * *  * *  * *  * *  * *  * *  * *  * *  * *  * *  * *  *)
  29.  
  30. Comp.lang.oberon Frequently Asked Questions: The Programming Language
  31.  
  32. Copyright 1994 Michael Gallo
  33. (c) 1994 Michael Gallo
  34.  
  35.  
  36. This is one of three documents that attempt to answer some frequently asked questions (FAQs) about Oberon.  This text concerns the Oberon languages, while the other two are about general topics and about Oberon the operating system.
  37.  
  38.  
  39. THE PROGRAMMING LANGUAGE OBERON 
  40.  
  41. >From "From Modula to Oberon"
  42.     The programming language Oberon is the result of a concentrated effort to increase the power of Modula-2 and simultaneously to reduce its complexity. Several features were eliminated, and a few were added in order to increase the expressive power and flexibility of the language. This paper describes and motivates the changes. The language is defined in a concise report.
  43.     Whereas modern languages, such as Modula, support the notion of extensibility in the procedural realm, the notion is less well established in the domain of data types. In particular, Modula does not allow the definition of new data types as extensions of other, programmer-defined types in an adequate manner. An additional feature was called for, thereby giving rise to an extension of Modula.
  44.     The evolution of a new language that is smaller, yet more powerful than its ancestor is contrary to common practices and trends, but has inestimable advantages. Apart from simpler compilers, it results in a concise defining document, an indispensable prerequisite for any tool that must serve in the construction of sophisticated and reliable systems.
  45.  
  46. Among the eliminations in the move from Modula-2 to Oberon are variant records, opaque types, enumeration types, subrange types, the basic type CARDINAL, local modules, and Modula's WITH statement.  The major addition to Oberon is the concept of type extension (i.e., single inheritance) for records.
  47.  
  48.  
  49. OBJECT ORIENTED PROGRAMMING IN OBERON
  50.  
  51. Oberon does not offer multiple inheritance.  However, it has been shown that multiple inheritance can be efficiently implemented in terms of single inheritance and been argued that multiple inheritance is therefore syntactic sugar that is rarely used in practice.  For details, see Templ (1993) and Mssenbck (1993). 
  52.  
  53. The original Oberon language does not offer built in "methods" as do many other languages supporting OOP.  Instead, conventional virtual methods can easily be implemented as a pointer to a procedure table, or "messages" can be sent to procedures as extensible records.  
  54.  
  55. While some people complain about Oberon's minimalistic support of object oriented programming, others feel that this is one of Oberon's strengths, that the language does not institutionalize aparticular approach to OOP (see the Comp.object FAQ list for an examination of several variations on the object oriented paradigm).  For another discussion, see Oberon2.OOP by H. Mssenbck.  
  56.  
  57.  
  58. THE PROGRAMMING LANGUAGE OBERON-2
  59.  
  60. >From "Differences between Oberon and Oberon-2"
  61.     Oberon-2 is a true extension of Oberon. . . .
  62.     One important goal for Oberon-2 was to make object oriented programming easier without sacrificing the conceptual simplicity of Oberon. After three years of using Oberon and its experimental offspring Object Oberon we merged our experiences into a single refined version of Oberon.
  63.     The new features of Oberon-2 are type-bound procedures [i.e., virtual methods], read-only export of variables and record fields, open arrays as pointer base types, and a with statement with variants. The for statement is reintroduced after having been eliminated in the step from Modula-2 to Oberon.
  64.  
  65.  
  66. THE "OBERON FAMILY" OF LANGUAGES
  67.  
  68. Mona is an experimental dialect (but not a superset) of Oberon which provides recursive data types (trees) as a first class data-structure.  It attempts to reduce reliance on pointers and to offer a faster alternative to automatic garbage collection.  For details, see ETH technical report 102.
  69.  
  70. Oberon-V is an experimental dialect (but not a superset) of Oberon.  It is concerned with issues of numerical computing, array processing, and code verification.  It's primary new features are the ALL statement (much like a parallel version of the FOR loop) and array constructors for open array parameters.  Since it was originally aimed at vector architectures in general and the Cray Y-MP in particular, no Oberon-V compiler has been implemented for the Oberon System.  For details, see Griesemer (1993).
  71.  
  72.  
  73. COMMON PROBLEMS PROGRAMMING IN OBERON
  74.  
  75. On numerical programming:
  76.  
  77. whitney@christie.Meakins.McGill.CA (Whitney de Vries) writes:
  78.     The gist of the situation is that numeric expressions [can be] too complex for the backend of the Oberon for Windows compiler. . . .  Complex expressions ( particularly those with floating point operations ) quickly exhausts the short supply of registers on the Intel chips. At this point it is worth noting that the ETH supports Oberon for Windows but does not consider the Intel chips to be an intresting research topic ( the answer to the Intel problem is to have more registers ).  I think it is unlikely t
  79. hat Intel compiler will ever be as robust as the POWERoberon compiler.
  80.     At any rate you will probably get your code to work if you simplify the expressions.
  81.  
  82.  
  83. The WITH statement:
  84.  
  85. "This [compiler error] has to be a bug, correct me if I'm wrong! (I'm going nuts over this)"
  86.  
  87. TYPE
  88.     Obj* = POINTER TO Empty;
  89.     Empty = RECORD (*nothing*) END;
  90.  
  91.     OpObj = POINTER TO OpNode;
  92.     OpNode = RECORD (Empty)
  93.         name : CHAR;
  94.         left, right : Obj;
  95.     END;
  96.  
  97. PROCEDURE doeval (ex: Obj): REAL;
  98.     BEGIN
  99.         WITH ex : OpObj DO
  100.             CASE ex.name OF
  101.                 "+" : RETURN doeval(ex.left (* err 113 *)) 
  102.                     + doeval(ex.right (* err 113 *));
  103.                 "-" : (* clever code here *)
  104.                 "*" : (* more clever code *)
  105.                 "/" : (* you get the idea *)
  106.             END;
  107.             (* et cetera *)
  108.         END;
  109.     END doeval;
  110.  
  111. Error #113 is an "incompatible assignment".  ex.left and ex.right certainly seem to be of type Obj.  Why won't doeval accept them?
  112.  
  113. As thutt@clark.net (Taylor Hutt) points out,
  114.     This is not a bug.  The WITH statement actually changes the static type of the WITHed variable for the entire duration of the WITH statement.  A workaround to this problem is to assign the parameter to a temporary variable and to use the WITH on the temp.  A type guard will not work properly in this case, do not attempt to use it.
  115.  
  116. Some people on Comp.lang.oberon think that the WITH statement should be avoided entirely because of its non-local effects.  They point out that a programmer can use individual type guards or, if a guarded variable is used very many times, can pass the variable to a procedure.
  117.  
  118.  
  119. BIBLIOGRAPHY
  120.  
  121. Sources cited in the FAQ list that are not listed in the bibliography are electronically available in PostScript and/or Oberon text formats from ETH Zrich's Oberon archive site in directory /pub/Oberon/Docu.
  122.  
  123. "Type Extensions" by N. Wirth; ACM Transactions on Programming Languages and Systems; 10, 2 (April 1988) 204-214.
  124.  
  125. "From Modula to Oberon" by N. Wirth; Software: Practice and Experience; 18,7 (July 1988) 661-670.
  126.  
  127. "The Programming Language Oberon" by N. Wirth; Software: Practice and Experience; 18,7 (July 1988) 671-690.
  128.  
  129. "Variations on the Role of Module Interfaces" by J. Gutknecht; Structured Programming; 10,1 (January 1989) 40-46.
  130.  
  131. "Object Oberon -- A Modest Object-Oriented Language" by H. Mssenbck and J. Templ; Structured Programming; 10,4 (April 1989) 199-207.
  132.  
  133. A New Approach to Formal Language Definition and Its Application to Oberon by M. Odersky; Verlag der Fachvereine Zrich; 1989.
  134.  
  135. "Oberon" by Dick Pountain; BYTE; volume 16 number 3 (March 1991).
  136.  
  137. "The Programming Language Oberon-2" by H. Mssenbck and N. Wirth; Structured Programming; 12,4 (April 1991).
  138.  
  139. Programming in Oberon: Steps Beyond Pascal and Modula-2 by M. Reiser and N. Wirth; ACM Press; 1992.
  140.  
  141. "A Systematic Approach to Multiple Inheritance Implementation" by J. Templ; ACM SIGPLAN Notices; Volume 28, Number 4 (April 1993).
  142.  
  143. Object Oriented Programming in Oberon-2 by H. Mssenbck; Springer Verlag; 1993.
  144.  
  145. "A Programming Language for Vector Computers" by R. Griesemer; Swiss Federal Institute of Technology (ETH Zrich); Dissertation Number 10277, 1993.
  146.  
  147. "The Oberon Programming Language" by Josef Templ; Dr. Dobb's Sourcebook #221 (Winter 1994).
  148.  
  149. "A comparison of object-oriented programming in four modern languages"; Software - Practice and Experience 24,11 (Nov. 94) 1077-1095.
  150.  
  151.  
  152. OBERON COMPILERS
  153.  
  154. Please note that mention of a product or company does not necessarily imply a recommendation.  For Oberon compilers developed outside ETH Zrich contact:
  155.  
  156. VAX/VMS:
  157.     ModulaWare GmbH, Wilhelmstr. 17A, D-91054 Erlangen/F.R.Germany
  158.         Modula-2 & Oberon-2 Compiler Manufactur
  159.         Tel. +49 (9131) 208395, Fax +49 (9131) 28205.
  160.         E-mail/Internet: 100023.2527@compuserve.com
  161.  
  162. MS-DOS and Windows:
  163.     ModulaWare GmbH, Wilhelmstr. 17A, D-91054 Erlangen/F.R.Germany
  164.         OM2 32 Bit Oberon-2 and Modula-2 Compiler for PC/DOS'386/'486 
  165.         native code for DOS with DPMI Driver/Host and for DOS sessions under Windows 3.1 and OS/2 2.1
  166.     COP2 (Oberon to C translator)
  167.         ftp: ftp.clark.net:/pub/thutt/cop2
  168.         e-mail: thutt@clark.net
  169.     Oberon-M
  170.         contact E. Videki, e-mail: erv@k2.everest.tandem.com
  171.     Extacy
  172.         Real Time Associates Ltd.
  173.         Canning House, 59 Canning Road
  174.         Croydon, Surrey, CRO 6QF
  175.         England
  176.         Tel.: 0044-81-656 7333
  177.         Fax: 0044-81-655 0401
  178.         E-mail: 71333.2346@compuserve.com
  179.         rta@rtal.demon.co.uk
  180.     Pow! (Programmers Oberon Workbench)
  181.         It works with MS-Windows and can be used to create native Windows applications (EXE's and DLL's).
  182.         Ftp: ftp.fim.uni-linz.ac.at:/pub/soft/pow-oberon2, or
  183.             galileo.meakins.mcgill.ca:/Oberon/CommercialDemos/POW
  184.         E-mail: pow@fim.uni-linz.ac.at
  185.         Mailing list: majordomo@fim.uni-linz.ac.at "subscribepow-list"
  186.     OM2-XDS
  187.         an Oberon-2 and ISO Modula-2 compiler producing ANSI C code
  188.         The eval kit is available by anonymous ftp from ftp.sun.ac.za:/pub/oberon/om2-xds/xds203.arj
  189.         The unrestricted version is available for a variety of other platforms.
  190.  
  191. Amiga:
  192.     A+L AG
  193.         Daederiz 61
  194.         CH-2540 Grenchen
  195.         Tel.: +41 (65) 52 03 11
  196.     Oberon-A 
  197.         A freely-distributable, stand-alone Oberon-2 compiler for the Commodore Amiga.  
  198.         It can be obtained from AmiNetsites, including ftp.cdrom.com and ftp.wustl.edu.
  199.         E-mail: fjc@wossname.apana.org.au
  200.  
  201. DECstation (Ultrix, OSF/1), Intel386 (SVR4, OS2, Solaris), Sparc(Solaris):
  202.     Office of Commercial Services
  203.     Queensland University of Technology
  204.     GPO box 2434, Brisbane Q4001
  205.     Australia
  206.  
  207. Alpha AXP:
  208.     A2O is a stand-alone compiler and generates OpenVMS AXP object files and supports the OpenVMS symbolic run-time             debugger as well as mixed language programming.
  209.     AOS (AXP Oberon System) which contains an AXP Oberon-2 compiler embedded in the Oberon System.  AOS runs                 on-top of OSF/Motif on a AXP workstation or on an XWindow terminal connected to an AXP server.
  210.     ModulaWare GmbH, Wilhelmstr. 17A, D-91054 Erlangen/F.R.Germany
  211.     Tel. +49 (9131) 208395, Fax +49 (9131) 28205.
  212.     E-mail/Internet: 100023.2527@compuserve.com
  213.  
  214. Atari:
  215.     Martin Momberg
  216.     Hahlgartenstr. 13a
  217.     D-64331 Weiterstadt
  218.     Germany
  219.     E-Mail: Inet:momberg@dik.maschinenbau.th-darmstadt.de
  220.     Ftp: ftp.th-darmstadt.de:/pub/machines/atari/programming/stoberon
  221.  
  222. Sun3:
  223.     Ulm Oberon system
  224.     ftp: anonymous@titania.mathematik.uni-ulm.de:/pub/soft/oberon/ulm/sun3
  225.  
  226. Misc:
  227.     The unrestricted version of OM2-XDS (see above) is available for a variety of platforms.
  228.  
  229. For ModulaWare products, please note that the company is soon moving.  The new address is valid from 01-Dec-1994:
  230.     ModulaWare GmbH
  231.     La Chanenche Haute
  232.     Meolans Revel
  233.     F-04350 Le Lauze
  234.     France
  235.     tel +33 92 81 30 99
  236.     E-mail 100023.2527@compuserve.com
  237.  
  238.